package cn.i96688.scanclient.bean;

import com.alibaba.fastjson.JSONObject;


public class MerInfo {
	private JSONObject infJson=new JSONObject();
	private MerInfo(){
	}
	
	private static MerInfo info=new MerInfo();
	public static MerInfo getInstance(){
		return info;
	}
	
	public String load(JSONObject data){
		if(data==null)
			return "数据为空，不能解析";
		if (Status.isFail(data)) { // 登录失败
			return data.getString(Status.NAME_MSG);
		} else { // 登录成功
			//2存入商户信息
			infJson.put("merId", data.getString("merId"));
			infJson.put("merName", data.getString("merName"));
			infJson.put("deviceCode", data.getString("deviceCode"));//设备编码
			
			return "";
		}
	}
	public JSONObject getMerInf(){
		return infJson;
	}
	
	public String getDeviceCode(){
		return infJson.getString("deviceCode");
	}
	
}
